package com.sam.security.service;

import java.util.List;
import java.util.Map;

import com.sam.core.domain.Page;
import com.sam.security.domain.AsyncTreeNode;
import com.sam.security.domain.Menu;
import com.sam.security.domain.Permission;
import com.sam.security.domain.Resource;
import com.sam.security.domain.Role;
import com.sam.security.domain.User;

/**
 * 权限模块业务接口
 * @project EMan
 * @author Sam
 * @version
 * @date Feb 17, 2009 10:27:27 AM
 */
public interface SecurityService {
	public User loadUser(String username, String password);

	public User loadUser(User user);

	public void addAllRolePermission(String roleId, String menuId);

	public void deleteAllRolePermission(String roleId, String menuId);

	public void deleteMenu(String menuId);

	public void deletePermission(String permissionId);

	public void deleteResource(String idString);

	public void deleteRole(String roleId);

	public void filterResource(Resource resource, Page<Resource> page);

	public List<AsyncTreeNode> loadPermissionTree(String roleId);

	public List<Resource> loadResource(int resourceId);

	public List<Resource> loadResource(Resource resource);

	public void loadResource(Resource resource, Page<Resource> page);

	public List<Role> loadRole(Role role, Page<Role> page);

	public List<Role> loadRole(String roleId);

	public List<Permission> queryCheckedPermission(String roleId, String menuId);

	public Menu queryMenuInfo(String id);

	public Permission queryPermissionInfo(String id);

	public List<Resource> queryPermissionResource(String permissionId);

	public List<Map<String, Object>> queryRequestMap();

	public List<AsyncTreeNode> querySubMenus(String id);

	public List<AsyncTreeNode> querySubMenusForPermission(String id);

	public List<AsyncTreeNode> querySubPermissions(String id);

	public List<Permission> queryUncheckedPermission(String roleId, String menuId);

	public List<Resource> queryUncheckedResource(String permissionId);

	public List<Resource> queryUncheckedResource(String permissionId, String query);

	public List<Resource> searchResource(String search);

	public void searchResource(String query, Page<Resource> page);

	public List<Role> searchRole(String query, Page<Role> page);

	public void updateMenu(Menu menu);

	public void updatePermission(Permission permission);

	public void updatePermissionResource(String permissionId, String[] resourceIds);

	public void updateResource(Resource resource);

	public void updateRole(Role role);

	public void updateRolePermission(String roleId, String menuId, String[] userFunctionNames);

	public void updateRolePermissionAll(String roleId, String menuId);
}
